package com.blue.alipay.init;

import com.blue.alipay.utils.date.DateUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @描述 初始化方法 做一个定时任务
 * @时间 2017-6-23 18:27
 * @作者 肖亦鸣
 */
public class Init {
    private static Logger logger = LogManager.getLogger(Init.class.getName());


    private static final ScheduledExecutorService service = Executors.newScheduledThreadPool(5);

    public Init() {
        logger.info("Timed tasks Init start...{}", DateUtil.getCurrentDate());
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
            }
        };
        service.scheduleAtFixedRate(runnable, 1, 60, TimeUnit.SECONDS);
        logger.info("Timed tasks Init end...{}", DateUtil.getCurrentDate());
    }

}
